\documentclass[E:/GsjzTle/main/main.tex]{subfiles}
\begin{document}

\begin{lstlisting}
double check(double x)
{
	double sum = 0;
	rep(i , 1 , n)
	sum = sum * x + a[i];
	return sum ;
}
while(r - l > esp)
{
	double lmid = l + (r - l) / 3;
	double rmid = r - (r - l) / 3;
	if(check(lmid) > check(rmid)) r = rmid;
	else if(check(lmid) < check(rmid)) l = lmid;
	else l = lmid , r = rmid;
}
cout << setprecision(5) << fixed << l << '\n' ;
\end{lstlisting}

\end{document}
